<script setup lang="ts">
import { Left, Home } from "@nutui/icons-vue";
import { useRouter } from "vue-router";
import { useNewsStore } from "@/store/modules/news";

const props = defineProps<{
  newsId: string;
}>();

const store = useNewsStore();
const router = useRouter();


const newsDetail = store.getNewsDetailById(+props.newsId);

const backNews = () => {
  router.back();
};


</script>

<template>
  <div class="min-h-screen bg-white">
    <div class="flex items-center justify-between h-14 px-2 border-inherit border-b-1">
      <div class="flex items-center gap-3">
        <Left @click="backNews" />
        <span>{{ newsDetail?.title }}</span>
      </div>
    </div>
    <div class="m-4" v-html="newsDetail?.text"></div>
  </div>
</template>
